package com.chainyoung.component_tmtrade.ui.mvp.model;


import com.chainyoung.common.di.scope.ActivityScope;
import com.chainyoung.common.di.scope.FragmentScope;
import com.chainyoung.common.integration.IRepositoryManager;
import com.chainyoung.common.mvp.BaseModel;
import com.chainyoung.common.utils.RxUtils;
import com.chainyoung.component_tmtrade.api.TradeService;
import com.chainyoung.component_tmtrade.bean.CurrencyMarketList;
import com.chainyoung.component_tmtrade.bean.RegionList;
import com.chainyoung.component_tmtrade.ui.mvp.contract.TradeCurrencyCoupleListContract;
import com.chainyoung.component_tmtrade.ui.mvp.contract.TradeCurrencyTypeListContract;

import java.util.TreeMap;

import javax.inject.Inject;

import io.reactivex.Flowable;

@FragmentScope
public class TradeCurrencyCoupleListModel extends BaseModel implements TradeCurrencyCoupleListContract.Model {

    @Inject
    public TradeCurrencyCoupleListModel(IRepositoryManager repositoryManager) {
        super(repositoryManager);
    }


    @Override
    public Flowable<CurrencyMarketList> getCurrencyMarketList(TreeMap<String, Object> map) {
        return mRepositoryManager.obtainRetrofitService(TradeService.class)
                .getCurrencyMarketList(map)
                .compose(RxUtils.<CurrencyMarketList>handleResult());
    }
}

